#ifndef __SHT40_H__
#define __SHT40_H__
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/i2c.h"
#include "esp_log.h"
#include "esp_system.h"


#define I2C_MASTER_SCL_IO           11    
#define I2C_MASTER_SDA_IO           12    
#define I2C_MASTER_NUM              0 
#define I2C_MASTER_FREQ_HZ          100000   
#define I2C_MASTER_TX_BUF_DISABLE   0    
#define I2C_MASTER_RX_BUF_DISABLE   0     
#define I2C_MASTER_TIMEOUT_MS       1000

#define SHT40_SENSOR_ADDR           0x44

#define SHT40_MEASURE_TEMP_CMD      0xFD  // 温度测量命令
#define SHT40_MEASURE_HUM_CMD       0xF6  // 湿度测量命令

void SHT40_init();
void SHT40_reading();
float  SHT40_readTemp();
float SHT40_readHumi();

#endif